async function loadLocations() {
  const keyword = document.getElementById('keyword').value;
  const type = document.getElementById('type').value;
  const sortby = document.getElementById('sortby').value;

  const result = await fetchLocations({ keyword, type, sortby });
  const container = document.getElementById('location-list');
  container.innerHTML = '';

  if (result.success && result.data.length) {
    for (const loc of result.data) {
      const card = document.createElement('div');
      card.className = 'location-card';
      card.innerHTML = `
        <img src="${loc.image || 'assets/images/default.jpg'}" alt="封面" />
        <h3>${loc.name}</h3>
        <p>类型：${loc.type}</p>
        <p>热度：${loc.heat}</p>
        <p>评分：<img src="assets/icons/star.svg" class="star-icon" /> ${loc.rating}</p>
      `;
      container.appendChild(card);
    }
  } else {
    container.innerHTML = '<p>暂无结果</p>';
  }
}
